Skip to content

docs: unify chart dimension settings into shared snippets (#4773)#7031

Merged
florent-leborgne merged 5 commits into
mainfrom
docs-issue-4773-chart-snippets
Jun 30, 2026
Merged

docs: unify chart dimension settings into shared snippets (#4773)#7031
florent-leborgne merged 5 commits into
mainfrom
docs-issue-4773-chart-snippets

Conversation

@florent-leborgne

@florent-leborgne florent-leborgne commented Jun 19, 2026

Copy link
Copy Markdown
Member

Summary

This PR addresses #4773 by single-sourcing the bucket dimension Data settings that Lens chart types share (Top values, Date histogram, Intervals, Filters, and Collapse by) into reusable snippets, and by bringing each page up to standard against the Kibana source so the lists are exhaustive and accurate.

Each page now shows only the functions that its dimensions actually support, with the same wording sourced from one place.

New snippets (explore-analyze/_snippets/)

  • lens-bucket-top-values.md: the Top values function. The default count is verified against source: 9 on {applies_to}stack: ga 9.4/serverless, and on stack: 9.0-9.3 it defaults to 5 for the first dimension and 3 for each additional dimension.
  • lens-bucket-date-histogram.md, lens-bucket-intervals.md, lens-bucket-filters.md: the remaining bucket functions.
  • lens-collapse-by.md: the dimension-level Collapse by control.

Pages rewired to include the snippets

  • Partition (pie-charts.md, waffle-charts.md, treemap-charts.md, mosaic-charts.md)
  • heat-map-charts.md, tag-cloud-charts.md, tables.md
  • XY (bar-charts.md, line-charts.md, area-charts.md)
  • metric-charts.md

Accuracy fixes made while single-sourcing (verified against elastic/kibana at HEAD)

  • Heat map: added the Filters function to both axes (the axis predicate is isBucketed, so Filters applies but was undocumented).
  • Metric: the Break down by dimension now lists the full bucket function set (Date histogram, Intervals, Filters) instead of Top values only, matching its isBucketed predicate.
  • Collapse by is now placed once per dimension and only where the editor exposes it: all partition dimensions, the XY and metric Break down by groups, and table Rows. It is correctly absent from XY horizontal axes, table Split metrics by columns, heat map axes, tag clouds, and gauges.
  • Intervals now documents granularity, custom ranges, and "Include empty rows" (on by default), which were missing on several pages.
  • The shared advanced-settings snippet had partition-specific "tile" wording neutralized so it reads correctly on every chart type.
  • Region map and gauge are intentionally left as-is: region map's Region key only accepts string buckets (Top values and Filters), and gauges have no bucket dimension.

Snippet consolidation

  • Merged the Top values primary/secondary snippet pair into a single snippet (the legacy default now states the real first-vs-additional-dimension rule rather than approximating it across two files).
  • Pointed the area chart vertical axis at the shared lens-value-advanced-settings.md snippet and removed the area-only variant, which was an incomplete duplicate of the same XY metric options.

Resolves

Closes #4773


AI-generated draft — created with Claude Opus 4.8.
Review all generated content for factual accuracy before merging.

Single-source the bucket dimension "Data" settings (Top values, Date
histogram, Intervals, Filters, and Collapse by) shared across Lens chart
types into reusable snippets, and bring each page up to standard against
the Kibana source:

- Add bucket-function snippets and a Collapse by snippet under
  explore-analyze/_snippets/.
- Rewire pie, waffle, treemap, mosaic, heat map, tag cloud, table, bar,
  line, area, and metric pages to include them.
- Add the Filters function to heat map axes and the full function set to
  the metric breakdown, which were missing.
- Place Collapse by once per dimension and only where the UI exposes it
  (partition dimensions, XY/metric breakdown, table rows).
- Neutralize partition-specific wording in the shared advanced-settings
  snippet so it reads correctly on every chart type.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Elastic Docs AI PR menu

Check the box to run an AI review for this pull request.

Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Elastic Docs Style Checker (Vale)

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

Reduce the number of near-identical snippets:

- Merge lens-bucket-top-values and its -secondary variant into one
  snippet. The legacy (9.0-9.3) default now states the real rule
  ("5 for the first dimension and 3 for each additional dimension")
  instead of approximating it across two files.
- Point area chart vertical-axis settings at the shared
  lens-value-advanced-settings snippet (verified the XY metric options
  against Kibana) and remove the redundant area-only variant, which was
  an incomplete duplicate.

Co-authored-by: Cursor <cursoragent@cursor.com>
@florent-leborgne florent-leborgne marked this pull request as ready for review June 19, 2026 18:58
@florent-leborgne florent-leborgne requested review from a team as code owners June 19, 2026 18:58
florent-leborgne and others added 2 commits June 19, 2026 20:59
)

Rarity is available for single-field terms on any field except
floating-point numeric types, not "non-numeric fields" as previously
stated. Align the setting name with the UI ("Max doc count per term").

Co-authored-by: Cursor <cursoragent@cursor.com>
@leemthompo

Copy link
Copy Markdown
Member

@copilot can you just make sure all the right chunks of prose have been replaced with their concomitant snippets?

Copilot AI commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@copilot can you just make sure all the right chunks of prose have been replaced with their concomitant snippets?

Verified — all inline bucket-dimension prose (Top values, Date histogram, Intervals, Filters, Collapse by) has been replaced with the corresponding snippet includes on every page listed in the PR:

  • Partition charts (pie, waffle, treemap, mosaic): all 4 bucket functions + Collapse by → snippets
  • Heat map: both axes → snippets (including the newly added Filters)
  • Tag cloud: → snippets (no Collapse by, as intended)
  • Tables: Rows and Split metrics by columns → snippets (Collapse by on Rows only)
  • XY charts (bar, line, area): horizontal axis + Break down by → snippets (Collapse by on Break down by only)
  • Metric: Break down by → snippets (all bucket functions + Collapse by)

No leftover inline descriptions remain, and the snippets are correctly absent from gauge and region map pages.

Copilot AI requested a review from leemthompo June 30, 2026 10:03

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs review summary

Focus areas

  • Style and clarity: Good. The single-sourcing approach is clean and the new snippet prose is concise and active. Two wording concerns flagged inline.
  • Jargon: KQL appears unexplained in lens-bucket-filters.md ("Define custom KQL filters"), but this was present in the pre-existing per-chart wording, not introduced by this PR.
  • Frontmatter and applies_to: All changed chart pages retain correct frontmatter. The applies_to usage in lens-bucket-top-values.md is structurally valid.
  • Content type fit: All pages remain how-to guides with appropriate structure. No regressions.
  • Parent issue satisfaction: Satisfied. #4773 asked for single-sourced bucket dimension settings; the PR delivers shared snippets covering Top values, Date histogram, Intervals, Filters, and Collapse by, and updates all 11 affected chart pages consistently.

Nits

  • metric-charts.md (breakdown section, ~line 493): The old text had a metric-specific note — "an additional tile named Other shows if the Group remaining values as 'Other' advanced option is on" — that made the tile-creation behavior explicit. The shared lens-breakdown-advanced-settings.md snippet says "On by default" but skips this visual effect. Low impact since "tiles" are established earlier on the page, but worth considering a one-liner addition specific to metric charts.
  • metric-charts.md (old Collapse by): The removed text listed `None` as the default option — useful for users who want to revert a previously set aggregation. The new generic snippet omits it. If None is selectable in the UI, consider documenting it or noting how to disable an active Collapse by setting.
  • area-charts.md line 188 (pre-existing, not introduced by this PR): The Breakdown Appearance section still reads "Allow you to customize how your breakdown data is displayed in line charts" — this should say "area charts".
  • tag-cloud-charts.md: "For best legibility, display 20 to 50 tags." — "display" reads slightly awkwardly here; "use" is more natural for guidance ("For best legibility, use between 20 and 50 tags.").

Notes

  • Vale returned zero findings against the 18 eligible files.
  • Snippet files do not need frontmatter; this is consistent with the rest of the _snippets/ directory.
  • The indentation difference between snippet includes (4 vs. 6 spaces for rank-by and histogram-settings) is pre-existing convention and not changed by this PR.

Generated by Docs review agent for issue #7031 · 108.9 AIC · ⌖ 9.22 AIC · ⊞ 10.7K

Comment thread explore-analyze/_snippets/lens-bucket-top-values.md Outdated
Comment thread explore-analyze/_snippets/lens-collapse-by.md Outdated

@leemthompo leemthompo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Words LGTM and the robots verified the snippet includes are all executed as intended.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@florent-leborgne florent-leborgne enabled auto-merge (squash) June 30, 2026 10:30
@florent-leborgne florent-leborgne merged commit 7fda39a into main Jun 30, 2026
7 checks passed
@florent-leborgne florent-leborgne deleted the docs-issue-4773-chart-snippets branch June 30, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify chart settings into snippets for proper single-sourcing

3 participants